<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>

<body>

    <div id="root">
        <input @keyup="test1">测试键盘事件1
        <input @keyup.enter="test2">测试键盘事件2
        <input @keyup.page-down="test3">测试键盘事件3
    </div>

</body>

<script type="text/javascript">
    const vm = new Vue({
        el: '#root',
        data: {

        },
        methods: {
            test1(e){
                console.log("触发了键盘事件", e)
            },
            test2(){
                console.log("按下了回车键")
            },
            test3(){
                console.log("按下PageDown")
            }
            
        }
    });

    Vue.config.productionTip = false  //阻止 vue 在启动时生成生产提示。
</script>

</html>